﻿<Window x:Class="SequenceViewer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:SequenceViewer"
        Title="Sequence Annotation Studio" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight">
    <Grid>
        <Grid x:Name="mainGrid">
            <DockPanel Margin="10">
                <ScrollViewer DockPanel.Dock="Left" x:Name="Viewer" Height="600" VerticalAlignment="Stretch" Visibility="Visible">
                    <Canvas x:Name="mainCanvas" Height="600" Width="720" Background="White" VerticalAlignment="Top"
                            MouseMove="mainCanvas_MouseMove" 
                            MouseUp="mainCanvas_MouseUp" 
                            MouseDown="mainCanvas_MouseDown"/>
                </ScrollViewer>
                <StackPanel DockPanel.Dock="Top" Margin="10" x:Name="FeaturePanel" Visibility="Visible">
                    <GroupBox Margin="0,5,0,5" Padding="5">
                        <GroupBox.Header>
                            <CheckBox x:Name="chkSelectAll" Content="Select All" Checked="SelectAll_Checked" Unchecked="SelectAll_Checked"/>
                        </GroupBox.Header>
                        <ListBox x:Name="lstSeqFeatures" BorderThickness="0" Width="200" Height="240">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <CheckBox x:Name="checkbox" IsChecked="True" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Key}"/>
                                            <TextBlock Text=" ("/>
                                            <TextBlock Text="{Binding Location.LocationStart}"/>
                                            <TextBlock Text=".."/>
                                            <TextBlock Text="{Binding Location.LocationEnd}"/>
                                            <TextBlock Text=")"/>
                                        </StackPanel>
                                    </CheckBox>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </GroupBox>
                    <GroupBox Header="Zoom (20% - 200%)"  Margin="0,0,0,5" Padding="10">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <TextBox Name="textBox1" Width="60" Height="20" Text="100" KeyUp="textBox1_KeyUp" TextAlignment="Center" Margin="0,0,10,0"/>
                            <TextBlock Name="textBlock2" Text="%" Height="16"/>
                        </StackPanel>
                    </GroupBox>
                    <GroupBox Header="Paging (Page Size: 100 - 10000)" Padding="10">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,5">
                                <TextBlock Text="Page Size "/>
                                <TextBox Name="txtPageSize" Width="60" Height="20" Text="1000" KeyUp="txtPageSize_KeyUp" TextAlignment="Center"/>
                                <TextBlock Text=" Nucleotides"/>
                            </StackPanel>
                            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
                                <TextBlock><Hyperlink x:Name="hlFirst" Click="Navigation_Click">&lt;&lt;</Hyperlink></TextBlock>
                                <TextBlock Margin="10,0"><Hyperlink x:Name="hlPrev" Click="Navigation_Click">&lt;</Hyperlink></TextBlock>
                                <TextBox Name="txtPage" Width="60" Height="20" Text="1" KeyUp="txtPage_KeyUp" TextAlignment="Center"/>
                                <TextBlock Text="of" Margin="5,0"/>
                                <TextBlock Name="tbTotalPages"/>
                                <TextBlock Margin="10,0"><Hyperlink x:Name="hlNext" Click="Navigation_Click">&gt;</Hyperlink></TextBlock>
                                <TextBlock><Hyperlink x:Name="hlLast" Click="Navigation_Click">&gt;&gt;</Hyperlink></TextBlock>
                            </StackPanel>
                        </Grid>
                    </GroupBox>
                </StackPanel>
                <StackPanel DockPanel.Dock="Bottom" VerticalAlignment="Center" Margin="10" x:Name="ButtonsPanels" Width="200">
                    <Button Content="Load Sequence (GenBank)" Name="btnLoadSequence" Click="btnLoadSequence_Click" Margin="0,5"/>
                    <Button Content="Save Sequence (GenBank)" IsEnabled="False" Name="btnSaveSequence" Click="btnSaveSequence_Click" Margin="0,5"/>
                    <Button Name="btnAddAnnotation" IsEnabled="False" Click="btnAddAnnotation_Click" Content="Add Annotation" Margin="0,5"/>
                    <Button Name="btnEditAnnotation" IsEnabled="False" Click="btnEditAnnotation_Click" Content="Edit Annotation" Margin="0,5"/>
                    <Button Name="btnDeleteAnnotation" IsEnabled="False" Click="btnDeleteAnnotation_Click" Content="Delete Annotation" Margin="0,5"/>
                </StackPanel>
            </DockPanel>
        </Grid>
        <Border Name="mainBorder" Visibility="Hidden" Background="#7F7F7F7F"/>
        <local:AnnotationMaster Grid.RowSpan="2" Width="480" Height="480" 
                               HorizontalAlignment="Center" VerticalAlignment="Center"
                               Visibility="Collapsed" x:Name="AnnotationMasterControl"
                               IsVisibleChanged="AnnotationMasterControl_IsVisibleChanged"/>
        <Border Name="WaitBorder" Visibility="Hidden" Background="#7F7F7F7F"/>
        <local:WaitControl x:Name="WaitSign" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Hidden"/>
    </Grid>
</Window>
